<?php

namespace App\Models\Message;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * Class Message
 * @package App\Models\Message
 * @version September 15, 2017, 7:17 am UTC
 */
class Message extends Model
{
    use SoftDeletes;

    public $table = 'messages';
    

    protected $dates = ['deleted_at'];


    public $fillable = [
        'name',
        'title',
        'subtitle',
        'long_desc',
        'start_at',
        'end_at',
        'online_at',
        'offline_at',
        'publish_at',
        'online_status',
        'publish_status',
        'created_at',
        'updated_at'
    ];

    /**
     * The attributes that should be casted to native types.
     *
     * @var array
     */
    protected $casts = [
        'name' => 'string',
        'title' => 'string',
        'subtitle' => 'string',
        'long_desc' => 'string'
    ];

    /**
     * Validation rules
     *
     * @var array
     */
    public static $rules = [
        'name' => 'required|max:100',
        'title' => 'max:100',
        'subtitle' => 'max:100',
        'content' => 'required',
        'start_at' => 'required|date',
        'end_at' => 'required|date'
    ];

    
}
